Deprecate table client scan_query in favor of QueryService - #893
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #893 +/- ##
==========================================
+ Coverage 82.36% 82.41% +0.04%
==========================================
Files 99 99
Lines 12753 12759 +6
Branches 1242 1242
==========================================
+ Hits 10504 10515 +11
+ Misses 1795 1790 -5
Partials 454 454
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
🟡 Changes recommended
The new docstrings use an invalid Sphinx .. deprecated:: directive form (missing required version) and the new warning behavior lacks accompanying tests to prevent regressions.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR deprecates the legacy Table client scan query APIs by emitting DeprecationWarning at runtime and documenting the deprecation, steering users toward QueryService (QuerySessionPool) while keeping existing functionality intact.
Changes:
- Added
DeprecationWarningemission forTableClient.scan_query,TableClient.async_scan_query, andydb.aio.TableClient.scan_query. - Introduced a shared deprecation message constant used across sync/async implementations.
- Added a top-of-file
CHANGELOG.mdentry describing the deprecation.
File summaries
| File | Description |
|---|---|
ydb/table.py |
Adds shared deprecation message and emits DeprecationWarning from the sync and “async_*” TableClient scan query methods; adds deprecation docstrings. |
ydb/aio/table.py |
Emits DeprecationWarning from the async table client scan_query and reuses the shared deprecation message. |
CHANGELOG.md |
Documents the deprecation as user-facing behavior. |
Review details
Suppressed comments (2)
ydb/table.py:1225
- Same issue here:
.. deprecated::without a version argument is invalid in Sphinx and may break autodoc builds. Prefer a plain-text deprecation note (or add an explicit version).
"""
.. deprecated::
Use QueryService (:class:`ydb.QuerySessionPool`) instead.
"""
ydb/table.py:1291
- Same Sphinx directive issue:
.. deprecated::without a version argument is invalid and can fail doc generation. Replace with plain text or include a version.
"""
.. deprecated::
Use QueryService (:class:`ydb.QuerySessionPool`) instead.
"""
- Files reviewed: 3/3 changed files
- Comments generated: 5
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
TableClient.scan_query,TableClient.async_scan_queryand the asyncscan_querynow raiseDeprecationWarningand point to QueryService (ydb.QuerySessionPool).No behaviour change beyond the warning — the methods still work.